{namespace lfe=SGalinski\Lfeditor\ViewHelpers}

<f:for each="{fluidTree}" as="treeNode" key="constantKey">
	<li>
		<f:for each="{treeNode.icons}" iteration="iterator" as="icon" reverse="TRUE">
			<lfe:extendedIf condition="{iterator.isLast}" and="{treeNode.children}">
				<f:then>
					<a href="javascript:openCloseTreeEntry(
					'{f:uri.resource(path: 'Icons')}',
					'ul-{constantKey}', 'icon-{constantKey}',
					{treeNode.isBottom})">
						<img id="icon-{constantKey}" src="{f:uri.resource(path: 'Icons/{icon.name}')}"
							alt="{icon.name}" style="margin-left: {icon.marginLeft}px;" />
					</a>
				</f:then>
				<f:else>
					<img src="{f:uri.resource(path: 'Icons/{icon.name}')}" alt="{icon.name}"
						style="margin-left: {icon.marginLeft}px;" />
				</f:else>
			</lfe:extendedIf>
		</f:for>

		<f:if condition="{treeNode.children}">
			<f:then>
				<a href="javascript:openCloseTreeEntry(
				'{f:uri.resource(path: 'Icons')}', 'ul-{constantKey}', 'icon-{constantKey}', {treeNode.isBottom})">
					{treeNode.label}
				</a>
				<ul id="ul-{constantKey}" class="tx-lfeditor-treeview"
					style="{f:if(condition: '{treeHide}', then: 'display: none')}">
					<f:render partial="TreeElement"
						arguments="{fluidTree: '{treeNode.children}', treeHide: '{treeHide}'}" />
				</ul>
			</f:then>
			<f:else>
				<f:link.action action="prepareEditConstant"
					controller="EditConstant"
					arguments="{constantKey: '{constantKey}'}">
					<span class="tx-lfeditor-{f:if(condition: '{treeNode.type} == 2', then: 'specialMarkup')}{f:if(condition: '{treeNode.type} == 1', then: 'badMarkup')}{f:if(condition: '{treeNode.type} == 0', then: 'goodMarkup')}">
						{treeNode.label}
					</span>
				</f:link.action>
			</f:else>
		</f:if>
	</li>
</f:for>